import request from "../utils/request"
import qs from "querystring"

export const empByPage = (query)=>{
    return request.get("/emp/by/page",{
        params: query,
        paramsSerializer:(params)=>{
            return qs.stringify(params)
        }
    })
}
export const empByCondition = (query)=>{
    return request.get("/emp/by/condition",{
        params: query,
        paramsSerializer:(params)=>{
            return qs.stringify(params)
        }
    })
}

export const saveOrUpdateEmp = (param) => {
    return request.post("/emp/saveOrUpdate",param);
}

export const deleteEmpById = (empId) => {
    return request.delete("/emp/"+empId);
} 

export const deleteEmpByBatch = (empIds) => {
    return request.delete("/emp/batchDelete?EmpIds="+empIds);
}
export const salesRepByRegion = (regionId)=>{
    return request.get("/emp/sales/by/region?regionId="+regionId);
}